<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <title>basic multiplanar</title>
    <style>
      section {
        margin: 20px;
      }
    </style>
  </head>
  <body style="font-family: sans-serif">
    <noscript>
      <strong
        >niivue doesn't work properly without JavaScript enabled. Please enable
        it to continue.</strong
      >
    </noscript>
    <!-- demo 1 -->
    <section>
      <div id="demo1" style="width: 90%; height: 400px">
        <canvas id="gl1" height="480" width="640"> </canvas>
      </div>
    </section>
    <script type="module">
      import * as niivue from "../dist/index.js";
      
      let query = window.location.search;
      const params = new URLSearchParams(query);
      let url = params.get("url");
      var volumeList1 = [
        // first item is background image
        {
          url: url ? url : "../images/mni152.nii.gz", //"./images/RAS.nii.gz", "./images/spm152.nii.gz",
          colormap: "gray",
          opacity: 1,
          visible: true,
        },
      ];
      var nv1 = new niivue.Niivue();
      await nv1.attachTo("gl1");
      nv1.loadVolumes(volumeList1);
      nv1.setSliceType(nv1.sliceTypeMultiplanar);
    </script>
  </body>
</html>
